import java.util.Scanner;

public class Solution {
    public void rotate(int[] nums, int k) {
        k %=nums.length;
        re(nums,0,nums.length-1);
        re(nums,0,k-1);
        re(nums,k-1,nums.length-1);
    }

    public void re(int[] num,int start,int end){
        while(start<end){
            int tmp=num[start];
            num[start]=num[end];
            num[end]=tmp;
            start+=1;
            end-=1;
        }
    }

    public static void main(String[] args) {

    }

}
